Skip to content

fix(wslc): clarify WSL runtime prerequisite - #656

Open
huzaifa-d wants to merge 2 commits into
mainfrom
huzaifa-d-investigate-issue-553
Open

fix(wslc): clarify WSL runtime prerequisite#656
huzaifa-d wants to merge 2 commits into
mainfrom
huzaifa-d-investigate-issue-553

Conversation

@huzaifa-d

@huzaifa-d huzaifa-d commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

📖 Description

Clarifies the WSLC error when WSL is too old. The error now points users to WSL 2.8.1+ and wsl --update; the getting-started guide is aligned.

🔗 References

Resolves #553

🔍 Validation

  • cargo fmt --all -- --check
  • cargo test -p wslc_common (45 passed)

✅ Checklist

  • Signed the Contributor License Agreement
  • Linked to an issue
  • Updated documentation (if applicable)
  • Updated Copilot instructions (if build, architecture, or conventions changed)
  • If this PR changes Cargo.lock, the dependency-feed-check check passes

📋 Issue Type

  • Bug fix
  • Feature
  • Task

Copilot AI review requested due to automatic review settings July 16, 2026 20:08
@huzaifa-d
huzaifa-d requested a review from a team as a code owner July 16, 2026 20:08
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR clarifies WSLC prerequisite failures when WslcCanRun reports missing components, aligning runtime requirements (WSL runtime package minimum) with the getting-started documentation and adding a regression test for the new message.

Changes:

  • Add a helper to produce a more specific WSLC prerequisite error when WslcCanRun reports WslPackage missing, and add a unit test covering the message contents.
  • Update the WSLC getting-started guide to consistently document the minimum WSL runtime version (2.8.0+) and clarify that wslcsdk.dll is a separate dependency.
Show a summary per file
File Description
src/backends/wslc/common/src/wsl_container_runner.rs Improves prerequisite failure messaging from WslcCanRun and adds a unit test for the updated message.
docs/wsl/wsl-container-getting-started.md Updates prerequisite and troubleshooting documentation to consistently state the WSLC minimum WSL runtime version and separate SDK DLL requirement.

Review details

  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment thread src/backends/wslc/common/src/wsl_container_runner.rs
Comment thread src/backends/wslc/common/src/wsl_container_runner.rs
}

fn wslc_prerequisite_error(missing: WslcComponentFlags) -> String {
if missing as u32 & WslcComponentFlags::WslPackage as u32 != 0 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WslcComponentFlags is a fieldless repr(u32) enum, but wslcsdk.h declares it as combinable flags. WslcCanRun can therefore return 3 when both components are missing, which is not a valid Rust enum discriminant and causes undefined behavior when read here. Please represent this FFI type as a transparent integer-backed bitmask and add coverage for combined values.

Comment thread src/backends/wslc/common/src/wsl_container_runner.rs Outdated
Comment thread src/backends/wslc/common/src/wsl_container_runner.rs
@microsoft-github-policy-service microsoft-github-policy-service Bot added the Needs-Author-Feedback Issue needs attention from issue or PR author label Jul 17, 2026
Comment thread src/backends/wslc/common/src/wsl_container_runner.rs Outdated
Comment thread docs/wsl/wsl-container-getting-started.md Outdated
Comment thread src/backends/wslc/common/src/wsl_container_runner.rs Outdated
huzaifa-msft and others added 2 commits July 28, 2026 12:01
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f46e1b1d-d428-4d1b-b9c3-b83ca7b35ec2
- Branch remediation guidance by missing component: VirtualMachinePlatform
  now tells the user to enable the Windows optional feature instead of
  incorrectly suggesting a WSL update, per review feedback (updating WSL
  does not enable Virtual Machine Platform).
- Standardize on 'WSLC runtime unavailable' wording across code and docs
  (was inconsistent with 'runtime not available' in some places).
- Add table-driven tests covering WslPackage, VirtualMachinePlatform,
  their combined value, and SdkNeedsUpdate, asserting the version and
  remediation guidance selected for each case.
- Align remaining docs mentions in wsl-container-support-plan.md with the
  same wording.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 28, 2026 19:06
@huzaifa-d
huzaifa-d force-pushed the huzaifa-d-investigate-issue-553 branch from e0681ed to a30461e Compare July 28, 2026 19:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Comments suppressed due to low confidence (4)

src/backends/wslc/common/src/wsl_container_runner.rs:343

  • WSLC_COMPONENT_FLAG_SDK_NEEDS_UPDATE is not handled here. When it is the only bit, the message merely says to ensure the SDK is installed; when combined with another bit, SDK guidance disappears entirely. Add a dedicated branch with an actionable SDK-update remedy, leaving the generic fallback only for unknown flags.
    if guidance.is_empty() {
        guidance.push("ensure WSL2 and the WSLC SDK are installed".to_string());

docs/wsl/wsl-container-getting-started.md:303

  • This troubleshooting row omits the SdkNeedsUpdate condition that WslcGetMissingComponents can report. Add the outdated/incompatible WSLC SDK case and its actionable remedy; otherwise users receiving that named component still cannot resolve the error from this guide.
| `WSLC runtime unavailable` | WSL runtime package is missing, older than 2.9.3, or the Virtual Machine Platform optional component is disabled | Update WSL with `wsl --update --pre-release`, verify the installed version with `wsl --version`, and enable the Virtual Machine Platform optional component if required. The WSLC SDK DLL is a separate dependency and does not replace the WSL runtime package. |

docs/wsl/wsl-container-getting-started.md:14

  • This newly added row duplicates the identical Windows 11 prerequisite immediately above it. Remove the duplicate so the table lists each requirement once.

This issue also appears on line 303 of the same file.

| **Windows 11** | Required for WSL2 and the WSLC SDK |

src/backends/wslc/common/src/wsl_container_runner.rs:340

  • This contradicts the PR description, which says the error should direct users to WSL 2.8.1+ and the stable wsl --update command. Requiring 2.9.3 from the pre-release channel is materially different. Confirm the actual runtime floor and align this message, its tests, the getting-started guide, and the PR description.

This issue also appears on line 342 of the same file.

            .push("install WSL 2.9.3 or newer and run `wsl --update --pre-release`".to_string());
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Medium

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs-Author-Feedback Issue needs attention from issue or PR author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wslc setup failed: WSLC runtime not available. Missing components: WslPackage. Ensure WSL2 and the WSLC SDK are installed.

5 participants